#include "color.h"

Color::Color() : Object3D()
{

}

Color::Color(const Color &color) : Object3D(color)
{

}

Color::Color(const double &red, const double &green, const double &blue) : Object3D(red,green,blue)
{

}

inline double Color::getRed()   const
{
    return x;
}

inline double Color::getGreen() const
{
    return y;
}

inline double Color::getBlue()  const
{
    return z;
}

inline void Color:: setRed(const double &red)
{
    x = red;
}

inline void Color:: setGreen(const double &green)
{
    y = green;
}

inline void Color:: setBlue(const double &blue)
{
    z = blue;
}


inline void Color::setColor(const double &red, const double &green, const double &blue)
{
    x = red;
    y = green;
    z = blue;
}


inline Color  Color::operator+(const Color &color) const
{
    return Color(color.x+x,color.y+y,color.z+z);
}

inline Color& Color::operator+=(const Color &color)
{
    x+=color.x;
    y+=color.y;
    z+=color.z;
    return(*this);
}


inline Color Color::operator*( const double &coef) const
{
    return Color(coef*x,coef*y,coef*z);
}

inline Color  Color::operator*(const Color &c) const
{
    return Color(x*c.x,y*c.y,z*c.z);
}

inline Color& Color::operator*=(const double &coef)
{
    x*=coef;
    y*=coef;
    z*=coef;
    return *this;
}

inline Color& Color::operator*=(const Color  &c)
{
    x*=c.x;
    y*=c.y;
    z*=c.z;
    return *this;
}

